Skip to content

Conversation

@V-Francois
Copy link
Contributor

Summary

This PR fixes a bug with neighbor lists that appears when there are fewer than 3 cells in any given direction.

Each cell keeps a list of its neighbors, which includes the cell "on the right" and the one "on the left".
If there are only two cells in this direction, then the one "on the left" and the one "on the right" are the same (because of periodic boundary conditions).
The previous implementation would add this cell twice to the list of neighbors, resulting in pairs of interactions being counted more than once. This is removed by ensuring that all neighbor cell IDs are unique.

Notes

Trailing white spaces in the file are removed (initially because my IDE does that automatically), which I think is overall a good practice, but I can revert the change if you want.

@V-Francois
Copy link
Contributor Author

@romainljsimon , @leonardogalliano : tagging you as I don't have permission to add you as reviewers.

FYI: you could create a Codeowner file on the repo to be automatically flagged as reviewers on PRs.

@romainljsimon romainljsimon self-requested a review January 15, 2026 10:26
Copy link
Member

@romainljsimon romainljsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @V-Francois for this important PR

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/neighbours.jl 72.63% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@romainljsimon romainljsimon merged commit 1a70166 into TheDisorderedOrganization:main Jan 15, 2026
4 checks passed
@V-Francois V-Francois deleted the fix/low-number-cells branch January 15, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants